﻿@using MASA.Blazor
@inherits LayoutComponentBase

<MApp>
    <MAppBar Flat Fixed Color="white" Class="m-bar--underline">
        <span>MASA EShop</span>
        <MSpacer></MSpacer>
        <AuthorizeView>
            <Authorized>
                <MMenu OffsetX Left OffsetY>
                    <Activator Context="_">
                        <MButton Icon Large><MIcon>mdi-account-circle-outline</MIcon></MButton>
                    </Activator>
                    <ChildContent>
                        <MList Dense>
                            <MListItem Link Click='()=>Navigation("order")'>
                                <MListItemIcon>
                                    <MIcon>mdi-bell</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    <MListItemTitle>
                                        订单中心
                                    </MListItemTitle>
                                </MListItemContent>
                            </MListItem>
                            <MListItem Link>
                                <MListItemIcon>
                                    <MIcon>mdi-account</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    <MListItemTitle>
                                        个人中心
                                    </MListItemTitle>
                                </MListItemContent>
                            </MListItem>
                            <MListItem Link Click='Logout'>
                                <MListItemIcon>
                                    <MIcon>mdi-logout</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    <MListItemTitle>
                                        退出登录
                                    </MListItemTitle>
                                </MListItemContent>
                            </MListItem>
                        </MList>
                    </ChildContent>
                </MMenu>
            </Authorized>
            <NotAuthorized>
                <MMenu>
                    <Activator Context="_">
                        <MButton Color="primary" OnClick='()=>Navigation("login")'>Login</MButton>
                    </Activator>
                </MMenu>
            </NotAuthorized>
        </AuthorizeView>
    </MAppBar>

    <MMain class="pt-16">
        @*<MImage Alt="example" Height="250" Src="https://picsum.photos/510/300?random" />*@
        <MContainer Fluid>
            <CascadingValue Value="this">
                @Body
            </CascadingValue>
        </MContainer>
    </MMain>
     <Message @bind-Visible="_message.Visible" Timeout="_message.Timeout" Type="_message.Type">
        @_message.Content
    </Message>
</MApp>

